From: Julien Grall Date: Wed, 1 Apr 2015 16:21:35 +0000 (+0100) Subject: xen/dts: Allow only IRQ translation that are mapped to main GIC X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3479 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=fda2386ffc639db7a529429dcdf05348aa8b14e0;p=xen.git xen/dts: Allow only IRQ translation that are mapped to main GIC Xen is only able to handle one GIC controller. Some platforms may contain other interrupt controllers. Make sure to only translate IRQ mapped into the GIC handled by Xen. Signed-off-by: Julien Grall Acked-by: Stefano Stabellini Acked-by: Ian Campbell --- diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index d1c716f2e9..26fa298112 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -1058,8 +1058,14 @@ int dt_irq_translate(const struct dt_raw_irq *raw, struct dt_irq *out_irq) { ASSERT(dt_irq_xlate != NULL); + ASSERT(dt_interrupt_controller != NULL); - /* TODO: Retrieve the right irq_xlate. This is only work for the gic */ + /* + * TODO: Retrieve the right irq_xlate. This is only works for the primary + * interrupt controller. + */ + if ( raw->controller != dt_interrupt_controller ) + return -EINVAL; return dt_irq_xlate(raw->specifier, raw->size, &out_irq->irq, &out_irq->type);